package com.mmall.product.service.impl;

import com.mmall.product.mapper.ProductMapper;
import com.mmall.product.mapper.ProductSkuMapper;
import com.mmall.pojo.entity.ProductEntity;
import com.mmall.product.service.ProductSkuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author gg
 * @version ProductSkuServiceImpl.java, v 0.1 2019-05-05 19:14 gg
 */
@Service("productSkuService")
public class ProductSkuServiceImpl implements ProductSkuService {

    @Resource
    private ProductSkuMapper productSkuMapper;

    @Resource
    private ProductMapper productMapper;

    @Override
    public Object getSkuListByProductId(Long productId) {
        ProductEntity productEntity = productMapper.selectByPrimaryKey(productId);
        if(productEntity == null){
            throw new IllegalArgumentException("该商品不存在");
        }
        List<ProductEntity> productEntityList = productSkuMapper.selectByProductId(productId);
        return null;
    }
}